/*
 * @Author: luojiajun
 * @Email: company.kachun@gmail.com
 * @Date: 2021-06-28 14:29:35
 * @FilePath: /src/main.js
 * @LastEditTime: 2021-07-15 09:37:11
 * @LastEditors: luojiajun
 */
import Vue from 'vue'

import Cookies from 'js-cookie'

import Element from 'element-ui'
import paginations from 'ant-design-vue/lib/pagination';

import {Button,Input,Table,Drawer,Icon,Select,Modal,
      FormModel,Upload,Radio,Tooltip,ConfigProvider,Tabs,
      message as antdMessage,Form,Layout,Popover} from 'ant-design-vue';
import zh_CN from "ant-design-vue/lib/locale-provider/zh_CN";

import './assets/styles/element-variables.scss'
import 'ant-design-vue/dist/antd.css';
import  './assets/iconfont/iconfont.css'
import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css
import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
import clipboard from '@/directive/clipboard'
import moment from 'moment';
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
import { parseTime,resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
import jsplumb from "jsplumb";
Vue.prototype.$jsplumb = jsplumb.jsPlumb;
import { HappyScroll } from 'vue-happy-scroll'
//自定义组件名
Vue.component('happy-scroll', HappyScroll)
// 引入css
import 'vue-happy-scroll/docs/happy-scroll.css'
import GeminiScrollbar from 'vue-gemini-scrollbar';
Vue.use(GeminiScrollbar);
// 自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar"
// 全局枚举值
import options from "@/enum/index.js";
import "./utils/instruction.js";
import Contextmenu from "vue-contextmenujs"
Vue.use(Contextmenu);
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.$enum = options;
Vue.prototype.zh_CN = zh_CN;
Vue.prototype.msgSuccess = function (msg) {
  this.$message({ showClose: true, message: msg, type: "success" });
}

Vue.prototype.msgError = function (msg) {
  this.$message({ showClose: true, message: msg, type: "error" });
}

Vue.prototype.msgInfo = function (msg) {
  this.$message.info(msg);
}
Vue.prototype.antdMessage = antdMessage;

// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)

Vue.use(permission)
Vue.use(clipboard)

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */

Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
})
// ant-design-vue-ui  start
Vue.use(Button);
Vue.use(Input);
Vue.use(Table);
Vue.use(Icon);
Vue.use(Select);
Vue.use(Modal);
Vue.use(FormModel);
Vue.use(Upload);
Vue.use(paginations);
Vue.use(ConfigProvider);
Vue.use(Tabs);
Vue.use(Form);
Vue.use(Layout);
Vue.use(Tooltip);
Vue.use(Radio);
Vue.use(Drawer);
Vue.use(Popover);
// ant-design-vue-ui  end
Vue.config.productionTip = false
new Vue({
  zh_CN,
  el: '#app',
  router,
  store,
  render: h => h(App)
})
